<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>邀请码管理</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16">
            <div class="buttons-group">
                #if($shiro.hasPermission("invite:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("invite:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("user:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="invite" :rules="ruleValidate" :label-width="120">
            <Form-item label="邀请码" prop="invitation">
                <i-input v-model="invite.invitation"/>
            </Form-item>
            <Form-item label="客户等级" prop="grade">
                <Radio-group v-model="invite.grade">
                    <Radio label="1">
                        <span>客户</span>
                    </Radio>
                    <Radio label="2">
                        <span>高级客户</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="手机号" prop="mobile">
                <i-input v-model="invite.mobile"/>
            </Form-item>
            <Form-item>
                提示：如填写手机号，则系统会通过短信方式发送邀请码。
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交并返回</i-button>
                <i-button v-if="!invite.id" type="primary" @click="handleSubmitAndNext('formValidate')">提交并新增下一个</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>
<script src="${rc.contextPath}/js/shop/invite.js?_${date.systemTime}"></script>
</body>
</html>